#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 5e5 + 5;
const int MX = (1 << 20) + 5;

int n, k;
int a[N];
int pos[MX];
int dp[N];

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> k;
  rep(i, 1, n) cin >> a[i];
  rep(i, 1, n) a[i] ^= a[i - 1];
  rep(i, 1, MX - 1) pos[i] = -1;
  pos[0] = 0, dp[0] = 0;
  rep(i, 1, n) {
    dp[i] = dp[i - 1];
    int j = pos[a[i] ^ k];
    if (j >= 0) dp[i] = max(dp[i], dp[j] + 1);
    pos[a[i]] = i;
  }
  cout << dp[n];
  return 0;
}